package com.iqik.base.base;

import java.lang.reflect.Constructor;

public class DemoTest {

    public static void main(String[] args) throws IllegalAccessException, InstantiationException {
        Constructor<?>[] declaredClasses = DemoSub.class.getConstructors();
        for (Constructor<?> declaredClass : declaredClasses) {
            System.out.println(declaredClass.getClass().newInstance());
        }
    }

    public static int tryDemo() {
        try {
            System.out.println("try");
            return 1;
        } catch (Exception e) {
            System.out.println("exception");
            return 0;
        } finally {
            System.out.println("finally");
        }
    }

    static class A{

        static synchronized void methodA() {
            System.out.println("method A");
            Thread.yield();
            System.out.println("method A..");
        }

        static synchronized void methodB() {
            System.out.println("method B");
        }
    }

}
